<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="795" border="0" align="center" cellpadding="2" cellspacing="2"  bgcolor = "#D4D0C8">
  <tr>
    <th colspan="4" valign="top"><div align="center">THỐNG KÊ HÀNG TỒN KHO</div></th>
  </tr>
  <tr class = "list">
    <td valign="top"><div align="center">Mặt Hàng</div></td>
    <td valign="top"><div align="center">Số Lượng Nhập</div></td>
    <td valign="top"><div align="center">Số Lượng Bán</div></td>
    <td valign="top"><div align="center">Số Lượng Tồn Kho</div></td>
  </tr>
  <?php 
    		if(is_array($data['listht'])){
    			foreach ($data['listht'] as $value){?>
  <tr>
  
    <td valign="top"><div align="center">
    	
    			<?php foreach ($data['listmh'] as $item){
    					if($item['MaMH'] == $value['MaMH']){
    						echo $item['TenMH'];
    					}
    				}
    			?>
    	</div></td>
    <td valign="top"><div align="center"><?php echo $value['SoLuongNhap'].' '.$item['DVT'];?></div></td>
    <td valign="top"><div align="center"><?php echo $value['SoLuongBan'].' '.$item['DVT'];?></div></td>
    <td valign="top"><div align="center"><?php echo $value['SoLuongNhap'] - $value['SoLuongBan'].' '.$item['DVT'];?></div></td>
  </tr>
    <?php 
    			}
    		}
    	?>

</table>
</body>
</html>
